package com.example.makerspace.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.makerspace.mapper.ApplicationStatusHandler;
import com.example.makerspace.mapper.FailReasonHandler;
import com.example.makerspace.mapper.MybatisListHandler;
import com.example.makerspace.model.ApplicationStatus;
import com.example.makerspace.model.FailMsg;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.sql.Date;
import java.util.List;

/**
 * @author River
 * @version 1.0
 * @date 2023/9/27 21:46
 * @description:
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "t_application", autoResultMap = true)
@Document(indexName = "t_application")
public class ApplicationDO extends BaseDO{

    @Field(name = "username", type = FieldType.Text, analyzer="ik_max_word")
    private String username;

    @Field(name = "project_name", type = FieldType.Text, analyzer="ik_max_word")
    private String projectName;

    @Field(name = "project_period", type = FieldType.Text, analyzer="ik_max_word")
    private String projectPeriod;

    @Field(name = "team_city", type = FieldType.Text, analyzer="ik_max_word")
    private String teamCity;

    @Field(name = "team_name", type = FieldType.Text, analyzer="ik_max_word")
    private String teamName;

    private Date companyRegistrationTime;

    @TableField(typeHandler = MybatisListHandler.class)
    @Field(name = "intention_region", type = FieldType.Text, analyzer="ik_max_word")
    private List<String> intentionRegion
            ;
    @Field(name = "project_type", type = FieldType.Text, analyzer="ik_max_word")
    private String projectType;

    @Field(name = "phone", type = FieldType.Text, analyzer="ik_max_word")
    private String phone;

    @Field(name = "team_introduction", type = FieldType.Text, analyzer="ik_max_word")
    private String teamIntroduction;

    @Field(name = "project_overview", type = FieldType.Text, analyzer="ik_max_word")
    private String projectOverview;

    @Field(name = "landing_demand", type = FieldType.Text, analyzer="ik_max_word")
    private String landingDemand;

    @Field(name = "cooperation_intention", type = FieldType.Text, analyzer="ik_max_word")
    private String cooperationIntention;

    @Field(name = "finance_situation", type = FieldType.Text, analyzer="ik_max_word")
    private String financeSituation;

    @Field(name = "finance_demand", type = FieldType.Text, analyzer="ik_max_word")
    private String financeDemand;
    private String attachments;
    private String status;

    @TableField(typeHandler = ApplicationStatusHandler.class)
    private List<ApplicationStatus> statusLine;

    @TableField(typeHandler = FailReasonHandler.class)
    private List<FailMsg> failHistory;

    private String msg;
}
